<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href="__ADMIN__/css/pintuer.css">
<link rel="stylesheet" href="__ADMIN__/css/admin.css">
<script src="__ADMIN__/js/jquery.js"></script>
<script src="__ADMIN__/js/pintuer.js"></script>
</head>
<body>

  <div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder"> 后台导航分组列表</strong> <a href="" style="float:right; display:none;">添加字段</a></div>
    <div class="padding border-bottom">
    <form method="post" action="" id="listform">
      <ul class="search" style="padding-left:10px;">
        <li> <a class="button border-main icon-plus-square-o" href="{:url('admin/adminnavgroup/add')}"> 添加分组</a> </li>
      </ul>
    </form>
    </div>
    <table class="table table-hover text-center">
      <tr>
        <th>ID</th>
        <th>分组名称</th>
        <th>分组排序</th>
        <th>分组状态</th>
        <th>分组描述</th>
        <th>创建时间</th>
        <th width="200">操作</th>
      </tr>
        {volist name="data" id="da"}
         <tr>
           <td><span>{$da.id}</span></td>
          <td>{$da.name}</td>
          <td>{$da.order}</td>
         {switch name="da.status"}
         {case value="应用"}<td>{$da.status}</td>{/case}
         {case value="禁用"}<td style="color:red;">{$da.status}</td>{/case}
         {/switch}
          <td>{$da.desc}</td>
          <td>{$da.create_time}</td>
          <td><div class="button-group">
            <a class="button border-main" href="{:url('admin/adminnavgroup/edi',['id'=>$da.id])}"><span class="icon-edit"></span> 修改</a>
            <a class="button border-red" href="javascript:void(0)" onclick="return del({$da.id})"><span class="icon-trash-o"></span> 删除</a>
          </div></td>
        </tr>
        {/volist}
      <tr>
        <td colspan="8">
          {$page}
        </td>
      </tr>
    </table>
  </div>

<script type="text/javascript">
//单个删除
function del(id) {
    if (confirm("您确定要删除吗?")) {
        $.ajax({
            type: "GET",
            url: "{:url('admin/adminnavgroup/del')}",
            data: "id=" + id,
            dataType: 'json',
            success: function (data) {
                if (data == true) {
                    alert('亲,您已删除成功!');
                    location.reload(true);
                } else {
                    alert('删除失败,发生了什么^O^');
                }
            },
            error: function (data) {
            },
        })
    } else {
        return false;
    }
}
</script>
</body>
</html>